﻿$(document).ready(function () {
	//Sample usage
	var isloggined = getCook('isloggined');
	$("#new-quote-box").hide();
	$("#account-box").hide();
	$("#home-page").hide();
	$("#login-page").show();
	
    if(isloggined == 'true'){
    	$("#new-quote-box").show();
    	$("#account-box").show();
    	$("#home-page").show();
    	$("#login-page").hide();
    }else{
    	$("#home-page").hide();
    	$("#login-page").show();
    }
});


function getCook(cookiename) {
	// Get name followed by anything except a semicolon
	var cookiestring=RegExp(""+cookiename+"[^;]+").exec(document.cookie);
	// Return everything after the equal sign
	return unescape(!!cookiestring ? cookiestring.toString().replace(/^[^=]+./,"") : "");
}